import 'package:flutter/material.dart';
import 'package:flutter_tech_shop/src/cart_controller.dart';
import 'package:get/get.dart';
import './src/screens/signIn_page.dart';
import './src/screens/signup_page.dart';
import './src/screens/home_page.dart';
import './src/screens/dash_board.dart';
import './src/screens/product_page.dart';

void main() async {
  Get.put(CartController());
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return GetMaterialApp(
      title: 'XJn',
      theme: ThemeData(
        primarySwatch: Colors.green,
      ),
      home: HomePage(pageTitle: 'Welcome'),
      /// 路由管理
      routes: <String, WidgetBuilder> {
        '/signup': (BuildContext context) =>  SignUpPage(),
        '/signin': (BuildContext context) =>  SignInPage(),
        '/dashboard': (BuildContext context) => Dashboard(pageTitle: 'title',),
        // '/productPage': (BuildContext context) => ProductPage(productData: null,),
      },
    );
  }
}
